#ifndef _DIRECTORY_
#define _DIRECTORY_
#include "server.h"
#define MAXSIZE 10

typedef struct stackNode_s{
    int dir;
    struct stackNode_s* pnext;
}stackNode_t;

typedef struct stackDir_s{
    stackNode_t* head;
    stackNode_t* tail;
    int stackSize;
}stackDir_t;

stackDir_t* stackDirInit(void);

int push(stackDir_t* dirStack, int dir);

int top(stackDir_t* dirStack);

int pop(stackDir_t* dirStack);

int delstack(stackDir_t* dirStack);

int pwd(stackDir_t* dirStack,MYSQL* mysql,char* pwds);

int cd(stackDir_t* dirStack,char* pathname,char* usrname,MYSQL* mysql);

char** ls(stackDir_t* dirStack,MYSQL* mysql);

int freeLS(char** lsconbin);

int getvrpath(const char* pathname,char* vrpath,stackDir_t* dirStack,MYSQL* mysql);

int info_file(char* name,int* parent_id,char* vrpath,char* usrname,MYSQL* mysql);

int my_mkdir(stackDir_t* dirStack,MYSQL* mysql,char* pathname,char* usrname);

int my_rmdir(stackDir_t* dirStack,MYSQL* mysql,char* pathname,char* usrname);
#endif
